package org.locker.domain.enums;

import cn.hutool.core.collection.CollUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.List;

/**
 * 订单状态
 *
 * @author locker
 */
@Getter
@AllArgsConstructor
public enum OrderStatusEnum {

    WAITING_FOR_PAYMENT("waiting_for_payment","待支付"),
    PAYMENT_IN_PROGRESS("payment_in_progress","支付中"),
    PAYMENT_SUCCESSFUL("payment_successful","支付成功"),
    IN_USED("in_used","使用中"),
    PAYMENT_FAILED("payment_failed","支付失败"),
    ORDER_CANCELLED("order_cancelled","订单取消"),
    USED_DONE("used_done","订单完成");

    private final String code;
    private final String desc;

    /**
     * 获取有效订单状态
     * @return
     */
    public static List<String> getActiveStatusList(){
        return CollUtil.newArrayList(
                WAITING_FOR_PAYMENT.getCode(),
                PAYMENT_IN_PROGRESS.getCode(),
                PAYMENT_SUCCESSFUL.getCode(),
                IN_USED.getCode());
    }


}
